package com.toggery.POS.tool;

import java.sql.Timestamp;
import java.text.SimpleDateFormat;
import java.util.Date;

public class DateTool {
    public static Date getNow(){
        SimpleDateFormat sdf = new SimpleDateFormat();
        // 格式化时间
        sdf.applyPattern("yyyy-MM-dd HH:mm:ss");
        // a为am/pm的标记
        Date date = new Date();
        // 获取当前时间
        String time = sdf.format(date.getTime());
        return Timestamp.valueOf(time);
    }
    public static void main(String[] args) {
        //测试
//        System.out.println(getOriginalPassword("201525"));
        System.out.println(getNow());
    }
}
